package cn.edu.cqut.mdm.test.module1;

import java.io.IOException;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import cn.edu.cqut.mdm.core.module.Module;
import cn.edu.cqut.mdm.core.publish.Publish;
@Module(uid="001", name="加密解密模块")
@Publish({"local", "json"})
public class Module1 {
	public String encode(String str){
		return new BASE64Encoder().encodeBuffer(str.getBytes());
	}
	public String decode(String str){
		try {
			return new String(new BASE64Decoder().decodeBuffer(str));
		} catch (IOException e) {
			e.printStackTrace();
		}
		return "";
	}
}
